<!DOCTYPE html>
<html>
<head>
    <title>首页 {$site_info.site_name|default=''}</title>
    <meta name="keywords" content="{$site_info.site_seo_keywords|default=''}"/>
    <meta name="description" content="{$site_info.site_seo_description|default=''}">
    <include file="public@head"/>
    <link href="__TMPL__/public/assets/css/slippry/slippry.css" rel="stylesheet">
    <link rel="stylesheet" href="__STATIC__/js/jquery-ui/jquery-ui.css">
    <hook name="before_head_end"/>
</head>
<body class="body-white">
<include file="public@nav"/>

<!--栏目 -->
<div class="column">
    <h2>填写学员信息及确认新生协议</h2>
</div>
<!--栏目 -->

<!--填写信息 -->
<div class="fill-in wrap" id="members">
    <form action="{:url('order/order/add_student_post')}" method="post" class="form-horizontal js-ajax-form margin-top-20">
    <h3>孩子信息
        <em >
            家校通内可添加多个孩子信息
        </em>
    </h3>
    <div class="fill-in-list childInfo"  >
        <ul>
            <li>
                <i>家长名字：</i>
                <span>
                    <if condition="empty($p_id_data.realname)">
                             <input type="text" name="user_login" placeholder="请输入家长姓名" class="srk" />
                        <else/>
                             <input type="text" name="user_login" value="{$p_id_data.realname}" readonly  disabled class="srk" />
                    </if>

                     <input type="hidden" name="redirect" value="{$redirect}" class="srk" />

                </span>
            </li>
            <li>
                <i>邮编：</i>
                <span>
                    <if condition="empty($p_id_data.zipcode)">
                        <input type="text" name="zipcode" placeholder="请输入邮编" class="srk" />
                        <else/>
                        <input type="text" name="zipcode" value="{$p_id_data.zipcode}" readonly  disabled class="srk" />
                    </if>
                </span>
            </li>
            <li>
                <i>地址：</i>
                <span>
                    <if condition="empty($p_id_data.address)">
                        <input type="text" name="address" placeholder="请输入地址" class="srk" />
                        <else/>
                        <input type="text" name="address" value="{$p_id_data.address}" readonly  disabled class="srk" />
                    </if>
                </span>
            </li>
            <li>
                <i>孩子姓名：</i>
                <span>
                    <input type="text" name="name" placeholder="请输入学生姓名" class="srk" />
                </span>
            </li>
            <li>
                <i>性别：</i>
                <span>
                    <select name="gender">
                        <option value='0' selected>请选择性别</option>
                        <option value='1'>男</option>
                        <option value='2'>女</option>
                    </select>
                </span>
            </li>
            <li>
                <i>出生日期：</i>
                <span>
                    <input type="text"  name="birthday" class="srk" placeholder="请选择生日" autocomplete="off">
                </span>
            </li>

            <li>
                <i>年级：</i>
                <span>
                    <select name="grade" id="grade">
                        <option value="1">一年级</option>
                        <option value="2">二年级</option>
                        <option value="3">三年级</option>
                        <option value="4">四年级</option>
                        <option value="5">五年级</option>
                        <option value="6">六年级</option>
                        <option value="7">七年级</option>
                        <option value="8">八年级</option>
                        <option value="9">九年级</option>
                        <option value="10">高一</option>
                        <option value="11">高二</option>
                        <option value="12">高三</option>
                    </select>
                </span>
            </li>
            <li>
                <i>学校全称：</i>
                <span>
                    <input type="text" name="school_name" placeholder="请输入学校全称" class="srk" id="school_name"/>
                </span>
            </li>
            <li>
                <i>信息来源：</i>
                <span>
                        <input type="checkbox"  value="1" name="information_sources_type[]">学校推荐</input>
                        <input type="checkbox"  value="2" name="information_sources_type[]">老师推荐</input>
                        <input type="checkbox"  value="3" name="information_sources_type[]">学校官方</input>
                        <input type="checkbox"  value="4" name="information_sources_type[]">学校微信</input>
                        <input type="checkbox"  value="5"  name="information_sources_type[]">新闻媒体</input>
                        <input type="checkbox"  value="6" name="information_sources_type[]">信箱广告</input>
                        <input type="checkbox"  value="7" name="information_sources_type[]">同学推荐</input>
                        <input type="checkbox"  value="8" name="information_sources_type[]">朋友介绍</input>
                        <input type="checkbox"  value="9" name="information_sources_type[]">其他</input>
                </span>
            </li>
            <li id="information_sources_teacher" style="display:none">
                <i>老师：</i>
                  <span>

                <input type="text" class="srk"  name="information_sources_teacher" placeholder="请输入推荐老师名字" class="srk" />
                </span>
            </li>
            <li id="information_sources_student" style="display:none">
                <i>学生：</i>
                <span>
                     <input type="text" class="srk"  name="information_sources_student" placeholder="请输入推荐学生名字" class="srk" />
                </span>
            </li>
            <li id="information_sources_friend"  style="display:none">
                <i>朋友：</i>
                   <span>
                     <input type="text" class="srk"  name="information_sources_friend" placeholder="请输入推荐朋友名字" class="srk" />
                </span>
            </li>
            <li id="information_sources_other" style="display:none">
                <i>其他：</i>
                   <span>
                     <input type="text"  class="srk" name="information_sources_other" placeholder="请输入输入其他信息" class="srk" />
                </span>
            </li>
            <li>
                <i>新生协议：</i>
                 <span>
                     <input type="checkbox" id="agreement">我已阅读
                    <a href="javacript:" class="read_read">新生协议</a>
                </span>
            </li>
        </ul>
    </div>

        <!--确认提交 -->
        <div class="fill-btn">
            <ul>
                <li>
                    <button class="bm js-ajax-submit" type="submit">确定</button>
                </li>
            </ul>
        </div>
        <!--确认提交 -->
    </form>
</div>
<!--填写信息 -->

<div class="clear"></div>


<!--ajax layer 弹窗-->
<include file="public@footer"/>

<include file="public@scripts"/>
<script type="text/javascript" src="__STATIC__/js/admin.js"></script>
<script src="__TMPL__/public/assets/js/slippry.min.js"></script>
<script type="text/javascript" src="__STATIC__/js/jquery-ui/jquery-ui.min.js"></script>

<script type="text/javascript">
    $(document).ready(function() {
        $('input[name="birthday"]').datepicker({
//          changeMonth: true,
            changeYear: true
        });//日期
//
//        $('body').on('click','#btn',function(){
//            var $addInfo=$('.childInfo');
//            $('.childInfo').append($addInfo.html());
//        })

    });

    $(function () {
        $("#home-slider").slippry({
            transition: 'fade',
            useCSS: true,
            captions: false,
            speed: 1000,
            pause: 3000,
            auto: true,
            preload: 'visible'
        });
        $("#home-slider").show();
    });

    $(".read_read").click(function(){
        layer.open();
    });
    
    $('button').click(function () {
        if(!$('#agreement').attr('checked')){
            Wind.use('noty', function () {
                noty({
                    text: "需先阅读新生协议",
                    type: 'error',
                    layout: 'center'
                });
            });
            return false;
        }
    })


    $("body").on('change','#grade',function(){
        var myDate=new Date();
        $selected=$(this).find('option:selected').val();
        month=myDate.getMonth()+1;
        console.log(month);
        if($selected==6 && month>=7 )
        {
            $("#school_name").attr('placeholder','请输入初中学校名称');
        }else{
            $("#school_name").attr('placeholder','请输入学校全称');
        }
    })

    groupCheckbox = $("input[name='information_sources_type\[\]']");
    $("input[name='information_sources_type\[\]']").click(function(){
       for(i=0;i<groupCheckbox.length;i++){
           if(groupCheckbox[i].checked){
               var val =groupCheckbox[i].value;
               if(val==2)
               { //老师
                   $("#information_sources_teacher").show();
               }
               if(val==7)
               { //学生
                   $("#information_sources_student").show();
               }
               if(val==8)
               { //朋友
                   $("#information_sources_friend").show();
               }
               if(val==9)
               { //其他
                   $("#information_sources_other").show();
               }
           }else{
               var val =groupCheckbox[i].value;
               if(val==2)
               { //老师
                   $("#information_sources_teacher").hide();
               }
               if(val==7)
               { //学生
                   $("#information_sources_student").hide();
               }
               if(val==8)
               { //朋友
                   $("#information_sources_friend").hide();
               }
               if(val==9)
               { //其他
                   $("#information_sources_other").hide();
               }
           }
       }
   })

</script>
<hook name="before_body_end"/>
</body>
</html>